<template>
  <a-row>
    <a-col :span="12">
      <a-card title="最优成本代价模型影响因子评分样本">
        <a-form
          style="min-height: 432px;"
          :form="form"
          :label-col="{ span: 7 }"
          :wrapper-col="{ span: 12 }"
        >
          <a-form-item
            v-for="(d, index) in modelCost"
            :key="index"
            :label="d.factorName"
          >
            <span class="ant-form-text">{{ d.scoreBestPredict + " " + d.unit }}</span>
          </a-form-item>
        </a-form>
      </a-card>
    </a-col>
    <a-col :span="12">
      <a-card title="最优设备代价模型影响因子评分样本">
        <a-form
          style="min-height: 432px;"
          :form="form"
          :label-col="{ span: 7 }"
          :wrapper-col="{ span: 12 }"
        >
          <a-form-item
            v-for="(d, index) in modelDevice"
            :key="index"
            :label="d.factorName"
          >
            <span class="ant-form-text">{{ d.scoreBestPredict + " " + d.unit }}</span>
          </a-form-item>
        </a-form>
      </a-card>
    </a-col>
  </a-row>
</template>

<script>
  import { GwListMixin } from '@/mixins/GwListMixin'
  import { gPostAction } from '@/api/manage'

  export default {
    name: 'F010403',
    mixins: [GwListMixin],
    data() {
      return {
        modelCost: {},
        modelDevice: {},
        form: this.$form.createForm(this),
        factorUnit: {
          "设备功耗": "℃",
          "设备温度": "℃",
          "CPU负载": "%",
          "内存利用率": "%",
          "磁盘读取IO": "MB/s",
          "磁盘写入IO": "MB/s",
        },
      }
    },
    mounted() {
      this.loadData()
    },
    methods: {
      loadData() {
        gPostAction(
          '/model/bestPredict',
          {
            modelType: 'DATACENTER_COST',
            title: "精确管控与供电制冷联动-统一管理联动平台-最优策略评估算法",
            content: "查看最优设备代价模型影响因子评分样本"
          },
          this.gBaseUrl
        ).then((res) => {
          const vos = res.vos
          if (vos) {
            this.modelCost = vos
          }
        })
        gPostAction(
          '/model/bestPredict',
          {
            modelType: 'DATACENTER_DEVICE',
            title: "精确管控与供电制冷联动-统一管理联动平台-最优策略评估算法",
            content: "查看最优成本代价模型影响因子评分样本"
          },
          this.gBaseUrl
        ).then((res) => {
          const vos = res.vos
          if (vos) {
            this.modelDevice = vos
          }
        })
      },
    },
    watch: {},
  }
</script>